package com.wyp.service.impl;

import com.wyp.mapper.TestpapersMapper;
import com.wyp.pojo.Testpapers;
import com.wyp.service.TestpapersService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

@Service
public class TestpapersServiceImpl implements TestpapersService {

    @Autowired
    private TestpapersMapper testpaperMapper;

    @Override
    public List<Map<String,Object>> qureyAllTestpapers() {
        return testpaperMapper.qureyAllTestpapers();
    }

    @Override
    public List<Map<String,Object>> qureyTestpapersByTestpapername(String testpapername) {
        return testpaperMapper.qureyTestpapersByTestpapername(testpapername);
    }

    @Override
    public List<Map<String,Object>> qureyTestpapersByExampapername(String testpapername) {
        return testpaperMapper.qureyTestpapersByExampapername(testpapername);
    }

    @Override
    public List<Map<String,Object>> qureyTestpapersByApartmentnameAccess(int apartmentid,String testpapername) {
        return testpaperMapper.qureyTestpapersByApartmentnameAccess(apartmentid,testpapername);
    }

    @Override
    public List<Map<String,Object>> qureyTestpapersByApartmentname(int apartmentid) {
        return testpaperMapper.qureyTestpapersByApartmentname(apartmentid);
    }

    @Override
    public List<Map<String,Object>> qureyTestpapersByAccess(int apartmentid) {
        return testpaperMapper.qureyTestpapersByAccess(apartmentid);
    }

    @Override
    public Map<String,Object> qureyTestpapersByid(int id) {
        return testpaperMapper.qureyTestpapersByid(id);
    }

    @Override
    public List<Map<String,Object>> qureyTestpapersExam() {
        return testpaperMapper.qureyTestpapersExam();
    }

    @Override
    public boolean addTestpapers(Testpapers testpapers) {
        return  (testpaperMapper.addTestpapers(testpapers) != 0);
    }

    @Override
    public boolean updateTestpapers(Testpapers testpapers) {
        return (testpaperMapper.updateTestpapers(testpapers) != 0);
    }

    @Override
    public boolean deleteTestpapers(Integer id) {
        return (testpaperMapper.deleteTestpapers(id) != 0);
    }
}
